/*
 Navicat Premium Data Transfer

 Source Server         : huangxu'Mac
 Source Server Type    : MySQL
 Source Server Version : 80019
 Source Host           : localhost
 Source Database       : ylmall

 Target Server Type    : MySQL
 Target Server Version : 80019
 File Encoding         : utf-8

 Date: 05/16/2020 14:18:37 PM
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
--  Table structure for `tbkorder`
-- ----------------------------
DROP TABLE IF EXISTS `tbkorder`;
CREATE TABLE `tbkorder` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `click_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '点击时间',
  `create_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '创建时间',
  `pay_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '付款时间',
  `settlement_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '结算时间',
  `tb_pay_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '淘宝付款时间',
  `item_id` varchar(32) NOT NULL DEFAULT '0' COMMENT '商品ID',
  `title` varchar(125) NOT NULL DEFAULT '0' COMMENT '商品标题',
  `image` varchar(150) NOT NULL DEFAULT '0' COMMENT '商品主图',
  `aliwangwang` varchar(55) NOT NULL DEFAULT '0' COMMENT '掌柜旺旺',
  `shop_title` varchar(255) NOT NULL DEFAULT '0' COMMENT '所属店铺',
  `total` smallint NOT NULL DEFAULT '0' COMMENT '商品数',
  `price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '商品单价',
  `category` varchar(25) NOT NULL DEFAULT '0' COMMENT '类目名称',
  `order_sn` varchar(18) NOT NULL DEFAULT '0' COMMENT '淘宝订单编号',
  `sub_order_sn` varchar(18) NOT NULL DEFAULT '0' COMMENT '淘宝子订单号',
  `order_stats` tinyint(1) NOT NULL DEFAULT '0' COMMENT '订单状态(1为订单失败,2为订单付款,3为订单成功,4为订单结算,默认0)',
  `type` varchar(16) NOT NULL DEFAULT '0' COMMENT '订单类型',
  `payment_amount` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '付款金额',
  `settlement_amount` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '结算金额',
  `commission_ratio` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '佣金比率',
  `commission` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '佣金金额',
  `subsidy_ratio` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '补贴比率',
  `subsidy_amount` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '补贴金额',
  `subsidy_type` varchar(16) NOT NULL DEFAULT '0' COMMENT '补贴类型',
  `income_ratio` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '收入比率',
  `split_ratio` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '分成比率',
  `income` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '提成',
  `tech_service_rate` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '技术服务费率',
  `tech_service_fee` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '技术服务费',
  `effect_estimates` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '付款预估收入',
  `estimated_income` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '结算预估收入',
  `source_id` int NOT NULL DEFAULT '0' COMMENT '来源媒体ID',
  `source_name` varchar(16) NOT NULL DEFAULT '0' COMMENT '来源媒体名称',
  `ad_id` int NOT NULL DEFAULT '0' COMMENT '广告位ID',
  `ad_name` varchar(16) NOT NULL DEFAULT '0' COMMENT '广告位名称',
  `transaction_platform` varchar(16) NOT NULL DEFAULT '0' COMMENT '成交平台',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '导入系统时间',
  `member_id` int NOT NULL DEFAULT '0' COMMENT '会员编号',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQUE_ITEM_ID_SN` (`item_id`,`order_sn`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=43 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='tbk晒单订单';

-- ----------------------------
--  Records of `tbkorder`
-- ----------------------------
BEGIN;
INSERT INTO `tbkorder` VALUES ('1', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '', '', '', '', '', '0', '0.00', '0', 'tbkorder123321123', 'tbkorder123321123', '0', '', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0', '', '0', '', '', '2020-05-16 12:16:20', '28');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
